package com.alipay.sofa.award.record.common.dal.dao;

import com.alipay.sofa.award.record.common.dal.dataobject.AwardRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AwardRecordMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(AwardRecord record);

    AwardRecord selectByPrimaryKey(Integer id);

    List<AwardRecord> getRecordsByActivityTimeAndUserId(@Param("activityTime") String activityTime,
                                                        @Param("userId") String userId);

    List<AwardRecord> getAllPagedRecords(@Param("startIndex") int startIndex,
                                         @Param("pageSize") int pageSize);

    List<AwardRecord> getSelfPagedRecords(@Param("userId") String userId,
                                          @Param("startIndex") int startIndex,
                                          @Param("pageSize") int pageSize);

    int updateByPrimaryKey(AwardRecord record);

    int updateValidRecordByPrimaryKey(AwardRecord awardRecord);

    int countAll();

    int countByActivityTime(String activityTime);

    int countByUserId(String userId);

    List<AwardRecord> getLastDayRecords(@Param("activityLastDate") String activityLastDate);
}